package org.wordpress.android.analytics;

import android.content.Context;
import android.content.SharedPreferences;

import androidx.annotation.Nullable;
import androidx.preference.PreferenceManager;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

public final class AnalyticsTracker {
    private static boolean mHasUserOptedOut;

    public static final String ACTIVITY_LOG_ACTIVITY_ID_KEY = "activity_id";
    public static final String NOTIFICATIONS_SELECTED_FILTER = "selected_filter";

    public static final String JETPACK_REST_CONNECT_SOURCE_KEY = "source";
    public static final String JETPACK_REST_CONNECT_STATE_STEP_KEY = "step";
    public static final String JETPACK_REST_CONNECT_STATE_KEY = "state";
    public static final String JETPACK_REST_CONNECT_STATE_STARTED = "started";
    public static final String JETPACK_REST_CONNECT_STATE_COMPLETED = "completed";
    public static final String JETPACK_REST_CONNECT_STATE_FAILED = "failed";

    @SuppressWarnings("LineLength")
    public enum Stat {
        // This stat is part of a funnel that provides critical information.  Before
        // making ANY modification to this stat please refer to: p4qSXL-35X-p2
        APPLICATION_OPENED,
        APPLICATION_CLOSED,
        APPLICATION_INSTALLED,
        APPLICATION_UPGRADED,
        READER_ACCESSED,
        READER_ARTICLE_COMMENTED_ON,
        READER_ARTICLE_COMMENT_REPLIED_TO("reader_article_commented_on"),
        READER_ARTICLE_COMMENTS_OPENED,
        READER_ARTICLE_COMMENT_LIKED,
        READER_ARTICLE_COMMENT_SHARED,
        READER_ARTICLE_COMMENT_UNLIKED,
        READER_ARTICLE_LIKED,
        READER_ARTICLE_DETAIL_LIKED,
        READER_ARTICLE_REBLOGGED,
        READER_ARTICLE_DETAIL_REBLOGGED,
        READER_ARTICLE_OPENED,
        READER_ARTICLE_UNLIKED,
        READER_ARTICLE_DETAIL_UNLIKED,
        READER_ARTICLE_RENDERED,
        READER_ARTICLE_VISITED,
        READER_ARTICLE_TEXT_HIGHLIGHTED,
        READER_ARTICLE_TEXT_COPIED,
        READER_COMMENT_TEXT_HIGHLIGHTED,
        READER_COMMENT_TEXT_COPIED,
        READER_USER_BLOCKED,
        READER_BLOG_BLOCKED,
        READER_BLOG_FOLLOWED("reader_site_followed"),
        READER_BLOG_PREVIEWED,
        READER_BLOG_UNFOLLOWED("reader_site_unfollowed"),
        READER_SUGGESTED_SITE_VISITED,
        READER_SUGGESTED_SITE_TOGGLE_FOLLOW,
        READER_DISCOVER_VIEWED,
        READER_INFINITE_SCROLL("reader_infinite_scroll_performed"),
        READER_LIST_FOLLOWED,
        READER_LIST_LOADED,
        READER_P2_SHOWN,
        READER_A8C_SHOWN,
        READER_LIST_PREVIEWED,
        READER_LIST_UNFOLLOWED,
        READER_TAG_FOLLOWED("reader_reader_tag_followed"),
        READER_TAG_LOADED,
        READER_TAG_PREVIEWED,
        READER_TAG_UNFOLLOWED("reader_reader_tag_unfollowed"),
        READER_SEARCH_LOADED,
        READER_SEARCH_PERFORMED,
        READER_SEARCH_RESULT_TAPPED("reader_searchcard_clicked"),
        READER_GLOBAL_RELATED_POST_CLICKED("reader_related_post_from_other_site_clicked"),
        READER_LOCAL_RELATED_POST_CLICKED("reader_related_post_from_same_site_clicked"),
        READER_VIEWPOST_INTERCEPTED,
        READER_BLOG_POST_INTERCEPTED,
        READER_FEED_POST_INTERCEPTED,
        READER_WPCOM_BLOG_POST_INTERCEPTED,
        READER_SIGN_IN_INITIATED,
        READER_WPCOM_SIGN_IN_NEEDED,
        READER_USER_UNAUTHORIZED,
        READER_POST_SAVED_FROM_OTHER_POST_LIST("reader_post_saved"),
        READER_POST_SAVED_FROM_SAVED_POST_LIST("reader_post_saved"),
        READER_POST_SAVED_FROM_DETAILS("reader_post_saved"),
        READER_POST_UNSAVED_FROM_OTHER_POST_LIST("reader_post_unsaved"),
        READER_POST_UNSAVED_FROM_SAVED_POST_LIST("reader_post_unsaved"),
        READER_POST_UNSAVED_FROM_DETAILS("reader_post_unsaved"),
        READER_SAVED_POST_OPENED_FROM_SAVED_POST_LIST("reader_saved_post_opened"),
        READER_SAVED_POST_OPENED_FROM_OTHER_POST_LIST("reader_saved_post_opened"),
        READER_SITE_SHARED,
        READER_FOLLOWING_FETCHED,
        READER_READING_PREFERENCES_OPENED,
        READER_READING_PREFERENCES_CLOSED,
        READER_READING_PREFERENCES_ITEM_TAPPED,
        READER_READING_PREFERENCES_SAVED,
        READER_ANNOUNCEMENT_CARD_DISMISSED,
        READER_TAGS_FEED_HEADER_TAPPED,
        READER_TAGS_FEED_MORE_FROM_TAG_TAPPED,
        STATS_ACCESSED,
        STATS_ACCESS_ERROR,
        STATS_PERIOD_ACCESSED,
        STATS_INSIGHTS_ACCESSED,
        STATS_INSIGHTS_MANAGEMENT_HINT_DISMISSED,
        STATS_INSIGHTS_MANAGEMENT_HINT_CLICKED,
        STATS_INSIGHTS_MANAGEMENT_ACCESSED,
        STATS_INSIGHTS_TYPE_MOVED_UP,
        STATS_INSIGHTS_TYPE_MOVED_DOWN,
        STATS_INSIGHTS_TYPE_REMOVED,
        STATS_INSIGHTS_MANAGEMENT_SAVED,
        STATS_INSIGHTS_MANAGEMENT_DISMISSED,
        STATS_INSIGHTS_MANAGEMENT_TYPE_ADDED,
        STATS_INSIGHTS_MANAGEMENT_TYPE_REMOVED,
        STATS_INSIGHTS_MANAGEMENT_TYPE_REORDERED,
        STATS_SUBSCRIBERS_ACCESSED,
        STATS_PERIOD_DAYS_ACCESSED("stats_period_accessed"),
        STATS_PERIOD_WEEKS_ACCESSED("stats_period_accessed"),
        STATS_PERIOD_MONTHS_ACCESSED("stats_period_accessed"),
        STATS_PERIOD_YEARS_ACCESSED("stats_period_accessed"),
        STATS_VIEW_ALL_ACCESSED,
        STATS_DATE_TAPPED_BACKWARD,
        STATS_DATE_TAPPED_FORWARD,
        STATS_INSIGHTS_TOTAL_LIKES_GUIDE_TAPPED,
        STATS_INSIGHTS_ACTION_BLOGGING_REMINDERS_CONFIRMED,
        STATS_INSIGHTS_ACTION_BLOGGING_REMINDERS_DISMISSED,
        STATS_INSIGHTS_ACTION_GROW_AUDIENCE_CONFIRMED,
        STATS_INSIGHTS_ACTION_GROW_AUDIENCE_DISMISSED,
        STATS_INSIGHTS_ACTION_SCHEDULE_POST_CONFIRMED,
        STATS_INSIGHTS_ACTION_SCHEDULE_POST_DISMISSED,
        STATS_INSIGHTS_VIEW_MORE,
        STATS_FOLLOWERS_VIEW_MORE_TAPPED,
        STATS_TOTAL_LIKES_ERROR,
        STATS_TOTAL_COMMENTS_ERROR,
        STATS_TAGS_AND_CATEGORIES_VIEW_MORE_TAPPED,
        STATS_VIEWS_AND_VISITORS_ERROR,
        STATS_VIEWS_AND_VISITORS_LINE_CHART_TAPPED,
        STATS_SUBSCRIBERS_CHART_TAPPED,
        STATS_INSIGHTS_VIEWS_VISITORS_TOGGLED,
        STATS_PUBLICIZE_VIEW_MORE_TAPPED,
        STATS_POSTS_AND_PAGES_VIEW_MORE_TAPPED,
        STATS_POSTS_AND_PAGES_ITEM_TAPPED,
        STATS_REFERRERS_VIEW_MORE_TAPPED,
        STATS_SUBSCRIBERS_VIEW_MORE_TAPPED,
        STATS_EMAILS_VIEW_MORE_TAPPED,
        STATS_REFERRERS_ITEM_TAPPED,
        STATS_REFERRERS_ITEM_LONG_PRESSED,
        STATS_REFERRERS_ITEM_MARKED_AS_SPAM,
        STATS_REFERRERS_ITEM_MARKED_AS_NOT_SPAM,
        STATS_CLICKS_VIEW_MORE_TAPPED,
        STATS_COUNTRIES_VIEW_MORE_TAPPED,
        STATS_OVERVIEW_BAR_CHART_TAPPED,
        STATS_OVERVIEW_ERROR,
        STATS_VIDEO_PLAYS_VIEW_MORE_TAPPED,
        STATS_SEARCH_TERMS_VIEW_MORE_TAPPED,
        STATS_AUTHORS_VIEW_MORE_TAPPED,
        STATS_FILE_DOWNLOADS_VIEW_MORE_TAPPED,
        STATS_TAPPED_BAR_CHART("stats_bar_chart_tapped"),
        STATS_OVERVIEW_TYPE_TAPPED_VIEWS,
        STATS_OVERVIEW_TYPE_TAPPED_VISITORS,
        STATS_OVERVIEW_TYPE_TAPPED_COMMENTS,
        STATS_OVERVIEW_TYPE_TAPPED_LIKES,
        STATS_SCROLLED_TO_BOTTOM,
        STATS_WIDGET_ADDED,
        STATS_WIDGET_REMOVED,
        STATS_WIDGET_TAPPED,
        STATS_LATEST_POST_SUMMARY_ADD_NEW_POST_TAPPED,
        STATS_LATEST_POST_SUMMARY_SHARE_POST_TAPPED,
        STATS_LATEST_POST_SUMMARY_VIEW_POST_DETAILS_TAPPED,
        STATS_LATEST_POST_SUMMARY_POST_ITEM_TAPPED,
        STATS_TAGS_AND_CATEGORIES_VIEW_TAG_TAPPED,
        STATS_AUTHORS_VIEW_POST_TAPPED,
        STATS_CLICKS_ITEM_TAPPED,
        STATS_VIDEO_PLAYS_VIDEO_TAPPED,
        STATS_DETAIL_POST_TAPPED,
        EDITOR_CREATED_POST("editor_post_created"),
        EDITOR_ADDED_PHOTO_VIA_DEVICE_LIBRARY("editor_photo_added"),
        EDITOR_ADDED_VIDEO_VIA_DEVICE_LIBRARY("editor_video_added"),
        EDITOR_ADDED_PHOTO_VIA_MEDIA_EDITOR("editor_photo_added"),
        EDITOR_ADDED_PHOTO_NEW("editor_photo_added"),
        EDITOR_ADDED_VIDEO_NEW("editor_video_added"),
        EDITOR_ADDED_PHOTO_VIA_WP_MEDIA_LIBRARY("editor_photo_added"),
        EDITOR_ADDED_VIDEO_VIA_WP_MEDIA_LIBRARY("editor_video_added"),
        EDITOR_ADDED_PHOTO_VIA_STOCK_MEDIA_LIBRARY("editor_photo_added"),
        MEDIA_PHOTO_OPTIMIZED,
        MEDIA_PHOTO_OPTIMIZE_ERROR,
        MEDIA_VIDEO_OPTIMIZED,
        MEDIA_VIDEO_CANT_OPTIMIZE,
        MEDIA_VIDEO_OPTIMIZE_ERROR,
        MEDIA_PICKER_OPEN_CAPTURE_MEDIA("media_picker_capture_media_opened"),
        MEDIA_PICKER_OPEN_SYSTEM_PICKER,
        MEDIA_PICKER_OPEN_DEVICE_LIBRARY("media_picker_device_library_opened"),
        MEDIA_PICKER_OPEN_WP_MEDIA("media_picker_wordpress_library_opened"),
        MEDIA_PICKER_OPEN_STOCK_LIBRARY,
        MEDIA_PICKER_OPEN_GIF_LIBRARY,
        MEDIA_PICKER_RECENT_MEDIA_SELECTED,
        MEDIA_PICKER_PREVIEW_OPENED,
        MEDIA_PICKER_SEARCH_EXPANDED,
        MEDIA_PICKER_SEARCH_COLLAPSED,
        MEDIA_PICKER_SEARCH_TRIGGERED,
        MEDIA_PICKER_SHOW_PERMISSIONS_SCREEN,
        MEDIA_PICKER_ITEM_SELECTED,
        MEDIA_PICKER_ITEM_UNSELECTED,
        MEDIA_PICKER_SELECTION_CLEARED,
        MEDIA_PICKER_OPENED,
        EDITOR_UPDATED_POST("editor_post_updated"),
        EDITOR_SCHEDULED_POST("editor_post_scheduled"),
        EDITOR_OPENED,
        POST_LIST_ACCESS_ERROR,
        POST_LIST_BUTTON_PRESSED,
        POST_LIST_ITEM_SELECTED,
        POST_LIST_AUTHOR_FILTER_CHANGED,
        POST_LIST_TAB_CHANGED,
        POST_LIST_VIEW_LAYOUT_TOGGLED,
        POST_LIST_SEARCH_ACCESSED,
        EDITOR_LAUNCHER,
        EDITOR_LAUNCHED_VIA_EDITOR_LAUNCHER,
        EDITOR_CLOSED,
        EDITOR_SESSION_START,
        EDITOR_SESSION_SWITCH_EDITOR,
        EDITOR_SESSION_TEMPLATE_APPLY,
        EDITOR_SESSION_END,
        EDITOR_PUBLISHED_POST("editor_post_published"),
        EDITOR_POST_PUBLISH_TAPPED,
        EDITOR_POST_SCHEDULE_CHANGED,
        EDITOR_POST_VISIBILITY_CHANGED,
        EDITOR_POST_TAGS_CHANGED,
        EDITOR_POST_PUBLISH_NOW_TAPPED,
        EDITOR_POST_PASSWORD_CHANGED,
        EDITOR_POST_CATEGORIES_ADDED,
        EDITOR_POST_FORMAT_CHANGED,
        EDITOR_POST_SLUG_CHANGED,
        EDITOR_POST_EXCERPT_CHANGED,
        EDITOR_SAVED_DRAFT("editor_draft_saved"),
        EDITOR_EDITED_IMAGE("editor_image_edited"), // Visual editor only
        EDITOR_UPLOAD_MEDIA_FAILED, // Visual editor only
        EDITOR_UPLOAD_MEDIA_RETRIED, // Visual editor only
        EDITOR_UPLOAD_MEDIA_PAUSED, // Visual editor only
        EDITOR_TAPPED_BLOCKQUOTE("editor_button_tapped"),
        EDITOR_TAPPED_BOLD("editor_button_tapped"),
        EDITOR_TAPPED_ELLIPSIS_COLLAPSE("editor_button_tapped"),
        EDITOR_TAPPED_ELLIPSIS_EXPAND("editor_button_tapped"),
        EDITOR_TAPPED_HEADING("editor_button_tapped"),
        EDITOR_TAPPED_HEADING_1("editor_button_tapped"),
        EDITOR_TAPPED_HEADING_2("editor_button_tapped"),
        EDITOR_TAPPED_HEADING_3("editor_button_tapped"),
        EDITOR_TAPPED_HEADING_4("editor_button_tapped"),
        EDITOR_TAPPED_HEADING_5("editor_button_tapped"),
        EDITOR_TAPPED_HEADING_6("editor_button_tapped"),
        EDITOR_TAPPED_HTML("editor_button_tapped"), // Visual editor only
        EDITOR_TAPPED_HORIZONTAL_RULE("editor_button_tapped"),
        EDITOR_TAPPED_IMAGE("editor_button_tapped"),
        EDITOR_TAPPED_ITALIC("editor_button_tapped"),
        EDITOR_TAPPED_LINK_ADDED("editor_button_tapped"),
        EDITOR_TAPPED_LIST("editor_button_tapped"),
        EDITOR_TAPPED_LIST_ORDERED("editor_button_tapped"), // Visual editor only
        EDITOR_TAPPED_LIST_UNORDERED("editor_button_tapped"), // Visual editor only
        EDITOR_TAPPED_NEXT_PAGE("editor_button_tapped"),
        EDITOR_TAPPED_PARAGRAPH("editor_button_tapped"),
        EDITOR_TAPPED_PREFORMAT("editor_button_tapped"),
        EDITOR_TAPPED_READ_MORE("editor_button_tapped"),
        EDITOR_TAPPED_STRIKETHROUGH("editor_button_tapped"),
        EDITOR_TAPPED_UNDERLINE("editor_button_tapped"),
        EDITOR_TAPPED_ALIGN_LEFT("editor_button_tapped"),
        EDITOR_TAPPED_ALIGN_CENTER("editor_button_tapped"),
        EDITOR_TAPPED_ALIGN_RIGHT("editor_button_tapped"),
        EDITOR_TAPPED_REDO("editor_button_tapped"),
        EDITOR_TAPPED_UNDO("editor_button_tapped"),
        EDITOR_AZTEC_TOGGLED_OFF, // Aztec editor only
        EDITOR_AZTEC_TOGGLED_ON, // Aztec editor only
        EDITOR_AZTEC_ENABLED, // Aztec editor only
        EDITOR_GUTENBERG_ENABLED("gutenberg_enabled"), // Gutenberg editor only
        EDITOR_GUTENBERG_DISABLED("gutenberg_disabled"), // Gutenberg editor only
        EDITOR_HELP_SHOWN,
        EDITOR_SETTINGS_FETCHED,
        LANDING_EDITOR_SHOWN,
        REVISIONS_LIST_VIEWED,
        REVISIONS_DETAIL_VIEWED_FROM_LIST("revisions_detail_viewed"),
        REVISIONS_DETAIL_VIEWED_FROM_SWIPE("revisions_detail_viewed"),
        REVISIONS_DETAIL_VIEWED_FROM_CHEVRON("revisions_detail_viewed"),
        REVISIONS_DETAIL_CANCELLED,
        REVISIONS_REVISION_LOADED,
        REVISIONS_LOAD_UNDONE,
        FOLLOWED_BLOG_NOTIFICATIONS_READER_ENABLED,
        FOLLOWED_BLOG_NOTIFICATIONS_READER_MENU_OFF,
        FOLLOWED_BLOG_NOTIFICATIONS_READER_MENU_ON,
        FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_OFF,
        FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_ON,
        FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_EMAIL_OFF,
        FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_EMAIL_ON,
        FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_EMAIL_INSTANTLY,
        FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_EMAIL_DAILY,
        FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_EMAIL_WEEKLY,
        FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_COMMENTS_OFF,
        FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_COMMENTS_ON,
        ME_ACCESSED("me_tab_accessed"),
        ME_GRAVATAR_TAPPED,
        ME_GRAVATAR_UPLOADED,
        ME_GRAVATAR_UPLOAD_UNSUCCESSFUL,
        ME_GRAVATAR_UPLOAD_EXCEPTION,
        EXPERIMENTAL_FEATURES_OPENED,
        APPLICATION_PASSWORD_LIST_OPENED,
        MY_SITE_ACCESSED("my_site_tab_accessed"),
        MY_SITE_ICON_TAPPED,
        MY_SITE_ICON_REMOVED,
        MY_SITE_ICON_SHOT_NEW,
        MY_SITE_ICON_GALLERY_PICKED,
        MY_SITE_ICON_CROPPED,
        MY_SITE_ICON_UPLOADED,
        MY_SITE_ICON_UPLOAD_UNSUCCESSFUL,
        NOTIFICATIONS_DISABLED,
        NOTIFICATIONS_ENABLED,
        NOTIFICATIONS_ACCESSED,
        NOTIFICATIONS_OPENED_NOTIFICATION_DETAILS("notifications_notification_details_opened"),
        NOTIFICATIONS_MISSING_SYNC_WARNING,
        NOTIFICATION_REPLIED_TO("notifications_replied_to"),
        NOTIFICATION_QUICK_ACTIONS_REPLIED_TO("notifications_replied_to"),
        NOTIFICATION_APPROVED("notifications_approved"),
        NOTIFICATION_QUICK_ACTIONS_APPROVED("notifications_approved"),
        NOTIFICATION_UNAPPROVED("notifications_unapproved"),
        NOTIFICATION_LIKED("notifications_comment_liked"),
        NOTIFICATION_QUICK_ACTIONS_LIKED("notifications_comment_liked"),
        NOTIFICATION_QUICK_ACTIONS_QUICKACTION_TOUCHED("quick_action_touched"),
        NOTIFICATION_UNLIKED("notifications_comment_unliked"),
        NOTIFICATION_TRASHED("notifications_trashed"),
        NOTIFICATION_FLAGGED_AS_SPAM("notifications_flagged_as_spam"),
        NOTIFICATION_SWIPE_PAGE_CHANGED("notifications_swipe_page_changed"),
        NOTIFICATION_PENDING_DRAFTS_TAPPED("notifications_pending_drafts_tapped"),
        NOTIFICATION_PENDING_DRAFTS_IGNORED("notifications_pending_drafts_ignored"),
        NOTIFICATION_PENDING_DRAFTS_DISMISSED("notifications_pending_drafts_dismissed"),
        NOTIFICATION_PENDING_DRAFTS_SETTINGS_ENABLED("notifications_pending_drafts_settings_enabled"),
        NOTIFICATION_PENDING_DRAFTS_SETTINGS_DISABLED("notifications_pending_drafts_settings_disabled"),
        NOTIFICATION_UPLOAD_MEDIA_SUCCESS_WRITE_POST("notifications_upload_media_success_write_post"),
        NOTIFICATION_UPLOAD_POST_ERROR_RETRY("notifications_upload_post_error_retry"),
        NOTIFICATION_UPLOAD_MEDIA_ERROR_RETRY("notifications_upload_media_error_retry"),
        NOTIFICATION_RECEIVED_PROCESSING_START("notifications_received_processing_start"),
        NOTIFICATION_RECEIVED_PROCESSING_END("notifications_received_processing_end"),
        NOTIFICATION_SHOWN,
        NOTIFICATION_TAPPED,
        NOTIFICATION_DISMISSED,
        OPENED_POSTS("site_menu_opened"),
        OPENED_PAGES("site_menu_opened"),
        OPENED_PAGE_PARENT("page_parent_opened"),
        OPENED_COMMENTS("site_menu_opened"),
        OPENED_VIEW_SITE("site_menu_opened"),
        OPENED_VIEW_SITE_FROM_HEADER("site_menu_opened"),
        OPENED_VIEW_ADMIN("site_menu_opened"),
        OPENED_MEDIA_LIBRARY("site_menu_opened"),
        OPENED_BLOG_SETTINGS("site_menu_opened"),
        OPENED_ACCOUNT_SETTINGS("account_settings_opened"),
        ACCOUNT_SETTINGS_CHANGE_USERNAME_SUCCEEDED,
        ACCOUNT_SETTINGS_CHANGE_USERNAME_FAILED,
        ACCOUNT_SETTINGS_CHANGE_USERNAME_SUGGESTIONS_FAILED,
        OPENED_APP_SETTINGS("app_settings_opened"),
        OPENED_MY_PROFILE("my_profile_opened"),
        OPENED_PEOPLE_MANAGEMENT("people_management_list_opened"),
        OPENED_PERSON("people_management_details_opened"),
        OPENED_PLUGIN_DIRECTORY("plugin_directory_opened"),
        OPENED_PLANS("site_menu_opened"),
        OPENED_PLANS_COMPARISON("plans_compare"),
        OPENED_SHARING_MANAGEMENT("site_menu_opened"),
        OPENED_SHARING_BUTTON_MANAGEMENT("sharing_buttons_opened"),
        ACTIVITY_LOG_LIST_OPENED,
        ACTIVITY_LOG_DETAIL_OPENED,
        ACTIVITY_LOG_REWIND_STARTED,
        ACTIVITY_LOG_FILTER_BAR_DATE_RANGE_BUTTON_TAPPED("activitylog_filterbar_range_button_tapped"),
        ACTIVITY_LOG_FILTER_BAR_ACTIVITY_TYPE_BUTTON_TAPPED("activitylog_filterbar_type_button_tapped"),
        ACTIVITY_LOG_FILTER_BAR_DATE_RANGE_SELECTED("activitylog_filterbar_select_range"),
        ACTIVITY_LOG_FILTER_BAR_ACTIVITY_TYPE_SELECTED("activitylog_filterbar_select_type"),
        ACTIVITY_LOG_FILTER_BAR_DATE_RANGE_RESET("activitylog_filterbar_reset_range"),
        ACTIVITY_LOG_FILTER_BAR_ACTIVITY_TYPE_RESET("activitylog_filterbar_reset_type"),
        JETPACK_BACKUP_LIST_OPENED,
        JETPACK_BACKUP_REWIND_STARTED,
        JETPACK_BACKUP_FILTER_BAR_DATE_RANGE_BUTTON_TAPPED("jetpack_backup_filterbar_range_button_tapped"),
        JETPACK_BACKUP_FILTER_BAR_DATE_RANGE_SELECTED("jetpack_backup_filterbar_select_range"),
        JETPACK_BACKUP_FILTER_BAR_DATE_RANGE_RESET("jetpack_backup_filterbar_reset_range"),
        JETPACK_SCAN_ACCESSED,
        JETPACK_SCAN_HISTORY_ACCESSED,
        JETPACK_SCAN_HISTORY_FILTER,
        JETPACK_SCAN_THREAT_LIST_ITEM_TAPPED,
        JETPACK_SCAN_THREAT_CODEABLE_ESTIMATE_TAPPED,
        JETPACK_SCAN_RUN_TAPPED,
        JETPACK_SCAN_IGNORE_THREAT_DIALOG_OPEN("jetpack_scan_ignorethreat_dialogopen"),
        JETPACK_SCAN_THREAT_IGNORE_TAPPED,
        JETPACK_SCAN_FIX_THREAT_DIALOG_OPEN("jetpack_scan_fixthreat_dialogopen"),
        JETPACK_SCAN_THREAT_FIX_TAPPED,
        JETPACK_SCAN_ALL_THREATS_OPEN("jetpack_scan_allthreats_open"),
        JETPACK_SCAN_ALL_THREATS_FIX_TAPPED("jetpack_scan_allthreats_fix_tapped"),
        JETPACK_SCAN_ERROR,
        OPENED_PLUGIN_LIST("plugin_list_opened"),
        OPENED_PLUGIN_DETAIL("plugin_detail_opened"),
        CREATE_ACCOUNT_INITIATED("account_create_initiated"),
        CREATE_ACCOUNT_EMAIL_EXISTS("account_create_email_exists"),
        CREATE_ACCOUNT_USERNAME_EXISTS("account_create_username_exists"),
        CREATE_ACCOUNT_FAILED("account_create_failed"),
        // This stat is part of a funnel that provides critical information.  Before
        // making ANY modification to this stat please refer to: p4qSXL-35X-p2
        CREATED_ACCOUNT("account_created"),
        CLOSE_ACCOUNT_FAILED,
        CLOSED_ACCOUNT,
        ACCOUNT_LOGOUT,
        SHARED_ITEM_READER("item_shared_reader"),
        ADDED_SELF_HOSTED_SITE("self_hosted_blog_added"),
        SIGNED_IN,
        SIGNED_INTO_JETPACK,
        INSTALL_JETPACK_SELECTED,
        INSTALL_JETPACK_CANCELLED("install_jetpack_canceled"),
        INSTALL_JETPACK_COMPLETED,
        INSTALL_JETPACK_REMOTE_START,
        INSTALL_JETPACK_REMOTE_COMPLETED,
        INSTALL_JETPACK_REMOTE_FAILED,
        INSTALL_JETPACK_REMOTE_CONNECT,
        INSTALL_JETPACK_REMOTE_LOGIN,
        INSTALL_JETPACK_REMOTE_RESTART,
        INSTALL_JETPACK_REMOTE_START_MANUAL_FLOW,
        INSTALL_JETPACK_REMOTE_ALREADY_INSTALLED,
        CONNECT_JETPACK_SELECTED,
        CONNECT_JETPACK_FAILED,
        PUSH_NOTIFICATION_RECEIVED,
        PUSH_NOTIFICATION_TAPPED("push_notification_alert_tapped"), // Same of opened
        UNIFIED_LOGIN_STEP,
        UNIFIED_LOGIN_INTERACTION,
        UNIFIED_LOGIN_FAILURE,
        LOGIN_ACCESSED,
        LOGIN_MAGIC_LINK_EXITED,
        LOGIN_MAGIC_LINK_FAILED,
        LOGIN_MAGIC_LINK_OPENED,
        LOGIN_MAGIC_LINK_REQUESTED,
        LOGIN_MAGIC_LINK_SUCCEEDED,
        LOGIN_FAILED("login_failed_to_login"),
        LOGIN_FAILED_TO_GUESS_XMLRPC,
        LOGIN_INSERTED_INVALID_URL,
        LOGIN_AUTOFILL_CREDENTIALS_FILLED,
        LOGIN_AUTOFILL_CREDENTIALS_UPDATED,
        LOGIN_PROLOGUE_PAGED,
        LOGIN_PROLOGUE_PAGED_JETPACK,
        LOGIN_PROLOGUE_PAGED_NOTIFICATIONS,
        LOGIN_PROLOGUE_PAGED_POST,
        LOGIN_PROLOGUE_PAGED_READER,
        LOGIN_PROLOGUE_PAGED_STATS,
        LOGIN_PROLOGUE_VIEWED,
        LOGIN_EMAIL_FORM_VIEWED,
        LOGIN_MAGIC_LINK_OPEN_EMAIL_CLIENT_VIEWED,
        LOGIN_MAGIC_LINK_OPEN_EMAIL_CLIENT_CLICKED,
        LOGIN_MAGIC_LINK_REQUEST_FORM_VIEWED,
        LOGIN_PASSWORD_FORM_VIEWED,
        LOGIN_URL_FORM_VIEWED,
        LOGIN_URL_HELP_SCREEN_VIEWED,
        LOGIN_CONNECTED_SITE_INFO_REQUESTED,
        LOGIN_CONNECTED_SITE_INFO_FAILED,
        LOGIN_CONNECTED_SITE_INFO_SUCCEEDED,
        LOGIN_USERNAME_PASSWORD_FORM_VIEWED,
        LOGIN_TWO_FACTOR_FORM_VIEWED,
        LOGIN_EPILOGUE_VIEWED,
        LOGIN_FORGOT_PASSWORD_CLICKED,
        LOGIN_SOCIAL_BUTTON_CLICK,
        LOGIN_SOCIAL_BUTTON_FAILURE,
        LOGIN_SOCIAL_CONNECT_SUCCESS,
        LOGIN_SOCIAL_CONNECT_FAILURE,
        LOGIN_SOCIAL_SUCCESS,
        LOGIN_SOCIAL_FAILURE,
        LOGIN_SOCIAL_2FA_NEEDED,
        LOGIN_SOCIAL_ACCOUNTS_NEED_CONNECTING,
        LOGIN_SOCIAL_ERROR_UNKNOWN_USER,
        LOGIN_WPCOM_WEBVIEW,
        LOGIN_WPCOM_BACKGROUND_SERVICE_UPDATE,
        // This stat is part of a funnel that provides critical information.  Before
        // making ANY modification to this stat please refer to: p4qSXL-35X-p2
        PAGES_SET_PARENT_CHANGES_SAVED("site_pages_set_parent_changes_saved"),
        PAGES_ADD_PAGE("site_pages_add_page"),
        PAGES_TAB_PRESSED("site_pages_tabs_pressed"),
        PAGES_OPTIONS_PRESSED("site_pages_options_pressed"),
        PAGES_SEARCH_ACCESSED("site_pages_search_accessed"),
        PAGES_EDIT_HOMEPAGE_INFO_PRESSED("site_pages_edit_homepage_info_pressed"),
        PAGES_EDIT_HOMEPAGE_ITEM_PRESSED("site_pages_edit_homepage_item_pressed"),
        SIGNUP_BUTTON_TAPPED,
        SIGNUP_EMAIL_BUTTON_TAPPED,
        SIGNUP_EMAIL_EPILOGUE_UNCHANGED("signup_epilogue_unchanged"),
        SIGNUP_EMAIL_EPILOGUE_UPDATE_DISPLAY_NAME_FAILED("signup_epilogue_update_display_name_failed"),
        SIGNUP_EMAIL_EPILOGUE_UPDATE_DISPLAY_NAME_SUCCEEDED("signup_epilogue_update_display_name_succeeded"),
        SIGNUP_EMAIL_EPILOGUE_UPDATE_USERNAME_FAILED("signup_epilogue_update_username_failed"),
        SIGNUP_EMAIL_EPILOGUE_UPDATE_USERNAME_SUCCEEDED("signup_epilogue_update_username_succeeded"),
        SIGNUP_EMAIL_EPILOGUE_USERNAME_SUGGESTIONS_FAILED("signup_epilogue_username_suggestions_failed"),
        SIGNUP_EMAIL_EPILOGUE_USERNAME_TAPPED("signup_epilogue_username_tapped"),
        SIGNUP_EMAIL_EPILOGUE_VIEWED("signup_epilogue_viewed"),
        SIGNUP_SOCIAL_BUTTON_TAPPED,
        SIGNUP_TERMS_OF_SERVICE_TAPPED,
        SIGNUP_CANCELED,
        SIGNUP_EMAIL_TO_LOGIN,
        SIGNUP_MAGIC_LINK_FAILED,
        SIGNUP_MAGIC_LINK_OPENED,
        SIGNUP_MAGIC_LINK_OPEN_EMAIL_CLIENT_CLICKED,
        SIGNUP_MAGIC_LINK_SENT,
        SIGNUP_MAGIC_LINK_SUCCEEDED,
        SIGNUP_SOCIAL_ACCOUNTS_NEED_CONNECTING,
        SIGNUP_SOCIAL_BUTTON_FAILURE,
        SIGNUP_SOCIAL_EPILOGUE_UNCHANGED("signup_epilogue_unchanged"),
        SIGNUP_SOCIAL_EPILOGUE_UPDATE_DISPLAY_NAME_FAILED("signup_epilogue_update_display_name_failed"),
        SIGNUP_SOCIAL_EPILOGUE_UPDATE_DISPLAY_NAME_SUCCEEDED("signup_epilogue_update_display_name_succeeded"),
        SIGNUP_SOCIAL_EPILOGUE_UPDATE_USERNAME_FAILED("signup_epilogue_update_username_failed"),
        SIGNUP_SOCIAL_EPILOGUE_UPDATE_USERNAME_SUCCEEDED("signup_epilogue_update_username_succeeded"),
        SIGNUP_SOCIAL_EPILOGUE_USERNAME_SUGGESTIONS_FAILED("signup_epilogue_username_suggestions_failed"),
        SIGNUP_SOCIAL_EPILOGUE_USERNAME_TAPPED("signup_epilogue_username_tapped"),
        SIGNUP_SOCIAL_EPILOGUE_VIEWED("signup_epilogue_viewed"),
        SIGNUP_SOCIAL_SUCCESS,
        SIGNUP_SOCIAL_TO_LOGIN,
        ENHANCED_SITE_CREATION_ACCESSED,
        ENHANCED_SITE_CREATION_DOMAINS_ACCESSED,
        ENHANCED_SITE_CREATION_DOMAINS_SELECTED,
        ENHANCED_SITE_CREATION_SUCCESS_LOADING,
        ENHANCED_SITE_CREATION_SUCCESS_PREVIEW_VIEWED,
        ENHANCED_SITE_CREATION_SUCCESS_PREVIEW_LOADED,
        ENHANCED_SITE_CREATION_PREVIEW_OK_BUTTON_TAPPED,
        ENHANCED_SITE_CREATION_EXITED,
        ENHANCED_SITE_CREATION_ERROR_SHOWN,
        ENHANCED_SITE_CREATION_BACKGROUND_SERVICE_UPDATED,
        ENHANCED_SITE_CREATION_SITE_DESIGN_VIEWED,
        ENHANCED_SITE_CREATION_SITE_DESIGN_SELECTED,
        ENHANCED_SITE_CREATION_SITE_DESIGN_SKIPPED,
        ENHANCED_SITE_CREATION_SITE_DESIGN_PREVIEW_VIEWED,
        ENHANCED_SITE_CREATION_SITE_DESIGN_PREVIEW_MODE_BUTTON_TAPPED,
        ENHANCED_SITE_CREATION_SITE_DESIGN_PREVIEW_MODE_CHANGED,
        ENHANCED_SITE_CREATION_SITE_DESIGN_PREVIEW_LOADING,
        ENHANCED_SITE_CREATION_SITE_DESIGN_PREVIEW_LOADED,
        ENHANCED_SITE_CREATION_INTENT_QUESTION_VIEWED,
        ENHANCED_SITE_CREATION_INTENT_QUESTION_CANCELED,
        ENHANCED_SITE_CREATION_INTENT_QUESTION_SKIPPED,
        ENHANCED_SITE_CREATION_INTENT_QUESTION_CUSTOM_VERTICAL_SELECTED,
        ENHANCED_SITE_CREATION_INTENT_QUESTION_VERTICAL_SELECTED,
        ENHANCED_SITE_CREATION_INTENT_QUESTION_SEARCH_FOCUSED,
        ENHANCED_SITE_CREATION_INTENT_QUESTION_EXPERIMENT,
        ENHANCED_SITE_CREATION_SITE_NAME_VIEWED,
        ENHANCED_SITE_CREATION_SITE_NAME_CANCELED,
        ENHANCED_SITE_CREATION_SITE_NAME_SKIPPED,
        ENHANCED_SITE_CREATION_SITE_NAME_ENTERED,
        LAYOUT_PICKER_PREVIEW_MODE_CHANGED,
        LAYOUT_PICKER_THUMBNAIL_MODE_BUTTON_TAPPED,
        LAYOUT_PICKER_PREVIEW_MODE_BUTTON_TAPPED,
        LAYOUT_PICKER_PREVIEW_LOADING,
        LAYOUT_PICKER_PREVIEW_LOADED,
        LAYOUT_PICKER_PREVIEW_VIEWED,
        LAYOUT_PICKER_ERROR_SHOWN,
        CATEGORY_FILTER_SELECTED,
        CATEGORY_FILTER_DESELECTED,
        // This stat is part of a funnel that provides critical information.  Before
        // making ANY modification to this stat please refer to: p4qSXL-35X-p2
        SITE_CREATED,
        MEDIA_LIBRARY_ADDED_PHOTO("media_library_photo_added"),
        MEDIA_LIBRARY_ADDED_VIDEO("media_library_video_added"),
        PERSON_REMOVED("people_management_person_removed"),
        PERSON_UPDATED("people_management_person_updated"),
        PUSH_AUTHENTICATION_APPROVED,
        PUSH_AUTHENTICATION_EXPIRED,
        PUSH_AUTHENTICATION_FAILED,
        PUSH_AUTHENTICATION_IGNORED,
        NOTIFICATION_SETTINGS_LIST_OPENED,
        NOTIFICATION_SETTINGS_STREAMS_OPENED,
        NOTIFICATION_SETTINGS_DETAILS_OPENED,
        NOTIFICATION_SETTINGS_APP_NOTIFICATIONS_DISABLED,
        NOTIFICATION_SETTINGS_APP_NOTIFICATIONS_ENABLED,
        NOTIFICATION_TAPPED_SEGMENTED_CONTROL,
        THEMES_ACCESSED_THEMES_BROWSER("themes_theme_browser_accessed"),
        THEMES_ACCESSED_SEARCH("themes_search_accessed"),
        THEMES_CHANGED_THEME("themes_theme_changed"),
        THEMES_PREVIEWED_SITE("themes_theme_for_site_previewed"),
        THEMES_DEMO_ACCESSED,
        THEMES_CUSTOMIZE_ACCESSED,
        THEMES_SUPPORT_ACCESSED,
        THEMES_DETAILS_ACCESSED,
        ACCOUNT_SETTINGS_LANGUAGE_CHANGED,
        SITE_SETTINGS_ACCESSED,
        SITE_SETTINGS_ACCESSED_MORE_SETTINGS("site_settings_more_settings_accessed"),
        SITE_SETTINGS_LEARN_MORE_CLICKED,
        SITE_SETTINGS_LEARN_MORE_LOADED,
        SITE_SETTINGS_ADDED_LIST_ITEM,
        SITE_SETTINGS_DELETED_LIST_ITEMS,
        SITE_SETTINGS_SAVED_REMOTELY,
        SITE_SETTINGS_HINT_TOAST_SHOWN,
        SITE_SETTINGS_START_OVER_ACCESSED,
        SITE_SETTINGS_START_OVER_CONTACT_SUPPORT_CLICKED,
        SITE_SETTINGS_EXPORT_SITE_ACCESSED,
        SITE_SETTINGS_EXPORT_SITE_REQUESTED,
        SITE_SETTINGS_EXPORT_SITE_RESPONSE_OK,
        SITE_SETTINGS_EXPORT_SITE_RESPONSE_ERROR,
        SITE_SETTINGS_DELETE_SITE_ACCESSED,
        SITE_SETTINGS_DELETE_SITE_PURCHASES_REQUESTED,
        SITE_SETTINGS_DELETE_SITE_PURCHASES_SHOWN,
        SITE_SETTINGS_DELETE_SITE_PURCHASES_SHOW_CLICKED,
        SITE_SETTINGS_DELETE_SITE_REQUESTED,
        SITE_SETTINGS_DELETE_SITE_RESPONSE_OK,
        SITE_SETTINGS_DELETE_SITE_RESPONSE_ERROR,
        SITE_SETTINGS_OPTIMIZE_IMAGES_CHANGED,
        SITE_SETTINGS_JETPACK_SECURITY_SETTINGS_VIEWED("jetpack_settings_viewed"),
        SITE_SETTINGS_JETPACK_ALLOWLISTED_IPS_VIEWED("jetpack_allowlisted_ips_viewed"),
        SITE_SETTINGS_JETPACK_ALLOWLISTED_IPS_CHANGED("jetpack_allowlisted_ips_changed"),
        ABTEST_START,
        FEATURE_FLAGS_SYNCED_STATE,
        REMOTE_FIELD_CONFIG_SYNCED_STATE,
        EXPERIMENT_VARIANT_SET,
        TRAIN_TRACKS_RENDER("traintracks_render"),
        TRAIN_TRACKS_INTERACT("traintracks_interact"),
        DEEP_LINKED,
        DEEP_LINKED_FALLBACK,
        DEEP_LINK_NOT_DEFAULT_HANDLER,
        MEDIA_UPLOAD_STARTED("media_service_upload_started"),
        MEDIA_UPLOAD_ERROR("media_service_upload_response_error"),
        MEDIA_UPLOAD_SUCCESS("media_service_upload_response_ok"),
        MEDIA_UPLOAD_CANCELED("media_service_upload_canceled"),
        APP_PERMISSION_GRANTED,
        APP_PERMISSION_DENIED,
        SHARE_TO_WP_SUCCEEDED,
        PLUGIN_ACTIVATED,
        PLUGIN_AUTOUPDATE_ENABLED,
        PLUGIN_AUTOUPDATE_DISABLED,
        PLUGIN_DEACTIVATED,
        PLUGIN_INSTALLED,
        PLUGIN_REMOVED,
        PLUGIN_SEARCH_PERFORMED,
        PLUGIN_UPDATED,
        STOCK_MEDIA_ACCESSED,
        STOCK_MEDIA_SEARCHED,
        STOCK_MEDIA_UPLOADED,
        GIF_PICKER_SEARCHED,
        GIF_PICKER_ACCESSED,
        GIF_PICKER_DOWNLOADED,
        SHORTCUT_STATS_CLICKED,
        SHORTCUT_NOTIFICATIONS_CLICKED,
        SHORTCUT_NEW_POST_CLICKED,
        AUTOMATED_TRANSFER_CONFIRM_DIALOG_SHOWN,
        AUTOMATED_TRANSFER_CONFIRM_DIALOG_CANCELLED,
        AUTOMATED_TRANSFER_CHECK_ELIGIBILITY,
        AUTOMATED_TRANSFER_NOT_ELIGIBLE,
        AUTOMATED_TRANSFER_INITIATE,
        AUTOMATED_TRANSFER_INITIATED,
        AUTOMATED_TRANSFER_INITIATION_FAILED,
        AUTOMATED_TRANSFER_STATUS_COMPLETE,
        AUTOMATED_TRANSFER_STATUS_FAILED,
        AUTOMATED_TRANSFER_FLOW_COMPLETE,
        AUTOMATED_TRANSFER_CUSTOM_DOMAIN_PURCHASED,
        AUTOMATED_TRANSFER_CUSTOM_DOMAIN_PURCHASE_FAILED,
        PUBLICIZE_SERVICE_CONNECTED,
        PUBLICIZE_SERVICE_DISCONNECTED,
        SUPPORT_OPENED,
        SUPPORT_HELP_CENTER_VIEWED,
        SUPPORT_MIGRATION_FAQ_VIEWED,
        SUPPORT_MIGRATION_FAQ_TAPPED,
        SUPPORT_NEW_REQUEST_VIEWED,
        SUPPORT_TICKET_LIST_VIEWED,
        SUPPORT_IDENTITY_FORM_VIEWED,
        SUPPORT_IDENTITY_SET,
        SUPPORT_OPEN_MOBILE_FORUM_TAPPED,
        SUPPORT_CHATBOT_STARTED,
        SUPPORT_CHATBOT_USER_SUBMITS_MESSAGE,
        SUPPORT_CHATBOT_TOPIC,
        SUPPORT_CHATBOT_WEBVIEW_ERROR,
        SUPPORT_CHATBOT_TICKET_SUCCESS,
        SUPPORT_CHATBOT_TICKET_FAILURE,
        SUPPORT_CHATBOT_ENDED,

        // Jetpack REST connection - these match iOS
        JETPACK_REST_CONNECT_STARTED,
        JETPACK_REST_CONNECT_LOGIN,
        JETPACK_REST_CONNECT_INSTALL,
        JETPACK_REST_CONNECT_SITE_CONNECTION,
        JETPACK_REST_CONNECT_USER_CONNECTION,
        JETPACK_REST_CONNECT_FINALIZE,
        JETPACK_REST_CONNECT_COMPLETED,
        JETPACK_REST_CONNECT_STEP_RETRIED,

        // these events are for the feedback form, which on iOS was originally part of the
        // in-app review feature.
        APP_REVIEWS_FEEDBACK_SCREEN_OPENED,
        APP_REVIEWS_FEEDBACK_SENT,
        APP_REVIEWS_FEEDBACK_SCREEN_CANCELED,

        QUICK_START_STARTED,
        QUICK_START_CARD_SHOWN,
        QUICK_START_TAPPED,
        QUICK_START_TASK_DIALOG_VIEWED,
        QUICK_START_TASK_DIALOG_NEGATIVE_TAPPED("quick_start_task_dialog_button_tapped"),
        QUICK_START_TASK_DIALOG_POSITIVE_TAPPED("quick_start_task_dialog_button_tapped"),
        QUICK_START_REMOVE_DIALOG_NEGATIVE_TAPPED("quick_start_remove_dialog_button_tapped"),
        QUICK_START_REMOVE_DIALOG_POSITIVE_TAPPED("quick_start_remove_dialog_button_tapped"),
        QUICK_START_TYPE_CUSTOMIZE_VIEWED("quick_start_list_viewed"),
        QUICK_START_TYPE_GROW_VIEWED("quick_start_list_viewed"),
        QUICK_START_TYPE_GET_TO_KNOW_APP_VIEWED("quick_start_list_viewed"),
        QUICK_START_TYPE_CUSTOMIZE_DISMISSED("quick_start_type_dismissed"),
        QUICK_START_TYPE_GROW_DISMISSED("quick_start_type_dismissed"),
        QUICK_START_TYPE_GET_TO_KNOW_APP_DISMISSED("quick_start_type_dismissed"),
        QUICK_START_LIST_CREATE_SITE_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_UPDATE_SITE_TITLE_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_VIEW_SITE_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_ADD_SOCIAL_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_PUBLISH_POST_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_FOLLOW_SITE_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_UPLOAD_ICON_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_CHECK_STATS_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_REVIEW_PAGES_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_CHECK_NOTIFICATIONS_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_UPLOAD_MEDIA_SKIPPED("quick_start_list_item_skipped"),
        QUICK_START_LIST_CREATE_SITE_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_UPDATE_SITE_TITLE_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_VIEW_SITE_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_ADD_SOCIAL_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_PUBLISH_POST_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_FOLLOW_SITE_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_UPLOAD_ICON_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_CHECK_STATS_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_REVIEW_PAGES_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_CHECK_NOTIFICATIONS_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_LIST_UPLOAD_MEDIA_TAPPED("quick_start_list_item_tapped"),
        QUICK_START_CREATE_SITE_TASK_COMPLETED("quick_start_task_completed"),
        QUICK_START_UPDATE_SITE_TITLE_COMPLETED("quick_start_task_completed"),
        QUICK_START_VIEW_SITE_TASK_COMPLETED("quick_start_task_completed"),
        QUICK_START_SHARE_SITE_TASK_COMPLETED("quick_start_task_completed"),
        QUICK_START_PUBLISH_POST_TASK_COMPLETED("quick_start_task_completed"),
        QUICK_START_FOLLOW_SITE_TASK_COMPLETED("quick_start_task_completed"),
        QUICK_START_UPLOAD_ICON_COMPLETED("quick_start_task_completed"),
        QUICK_START_CHECK_STATS_COMPLETED("quick_start_task_completed"),
        QUICK_START_REVIEW_PAGES_TASK_COMPLETED("quick_start_task_completed"),
        QUICK_START_CHECK_NOTIFICATIONS_TASK_COMPLETED("quick_start_task_completed"),
        QUICK_START_UPLOAD_MEDIA_TASK_COMPLETED("quick_start_task_completed"),
        QUICK_START_ALL_TASKS_COMPLETED,
        QUICK_START_REQUEST_VIEWED("quick_start_request_dialog_viewed"),
        QUICK_START_REQUEST_DIALOG_NEGATIVE_TAPPED("quick_start_request_dialog_button_tapped"),
        QUICK_START_REQUEST_DIALOG_POSITIVE_TAPPED("quick_start_request_dialog_button_tapped"),
        QUICK_START_NOTIFICATION_DISMISSED,
        QUICK_START_NOTIFICATION_SENT,
        QUICK_START_NOTIFICATION_TAPPED,
        QUICK_START_HIDE_CARD_TAPPED,
        QUICK_START_REMOVE_CARD_TAPPED,
        INSTALLATION_REFERRER_OBTAINED,
        INSTALLATION_REFERRER_FAILED,
        GUTENBERG_WARNING_CONFIRM_DIALOG_SHOWN,
        GUTENBERG_WARNING_CONFIRM_DIALOG_YES_TAPPED,
        GUTENBERG_WARNING_CONFIRM_DIALOG_CANCEL_TAPPED,
        GUTENBERG_WARNING_CONFIRM_DIALOG_DONT_SHOW_AGAIN_CHECKED,
        GUTENBERG_WARNING_CONFIRM_DIALOG_DONT_SHOW_AGAIN_UNCHECKED,
        GUTENBERG_WARNING_CONFIRM_DIALOG_LEARN_MORE_TAPPED,
        APP_REVIEWS_SAW_PROMPT,
        APP_REVIEWS_CANCELLED_PROMPT,
        APP_REVIEWS_RATED_APP,
        APP_REVIEWS_DECLINED_TO_RATE_APP("app_reviews_declined_to_rate_apt"),
        APP_REVIEWS_DECIDED_TO_RATE_LATER,
        APP_REVIEWS_EVENT_INCREMENTED_BY_UPLOADING_MEDIA("app_reviews_significant_event_incremented"),
        APP_REVIEWS_EVENT_INCREMENTED_BY_CHECKING_NOTIFICATION("app_reviews_significant_event_incremented"),
        APP_REVIEWS_EVENT_INCREMENTED_BY_PUBLISHING_POST_OR_PAGE("app_reviews_significant_event_incremented"),
        APP_REVIEWS_EVENT_INCREMENTED_BY_OPENING_READER_POST("app_reviews_significant_event_incremented"),
        DOMAIN_CREDIT_PROMPT_SHOWN,
        DOMAIN_CREDIT_REDEMPTION_TAPPED,
        DOMAIN_CREDIT_REDEMPTION_SUCCESS,
        DOMAIN_CREDIT_SUGGESTION_QUERIED,
        DOMAIN_CREDIT_NAME_SELECTED,
        DOMAINS_DASHBOARD_VIEWED,
        DOMAINS_DASHBOARD_GET_DOMAIN_TAPPED,
        DOMAINS_DASHBOARD_GET_PLAN_TAPPED,
        DOMAINS_DASHBOARD_ADD_DOMAIN_TAPPED,
        DOMAINS_SEARCH_SELECT_DOMAIN_TAPPED("domains_dashboard_select_domain_tapped"),
        DOMAINS_REGISTRATION_FORM_VIEWED,
        DOMAINS_REGISTRATION_FORM_SUBMITTED,
        DOMAINS_PURCHASE_WEBVIEW_VIEWED,
        DOMAINS_PURCHASE_DOMAIN_SUCCESS,
        QUICK_LINK_RIBBON_PAGES_TAPPED("quick_action_ribbon_tapped"),
        QUICK_LINK_RIBBON_POSTS_TAPPED("quick_action_ribbon_tapped"),
        QUICK_LINK_RIBBON_MEDIA_TAPPED("quick_action_ribbon_tapped"),
        QUICK_LINK_RIBBON_STATS_TAPPED("quick_action_ribbon_tapped"),
        QUICK_LINK_RIBBON_MORE_TAPPED("quick_action_ribbon_tapped"),
        OPENED_QUICK_LINK_RIBBON_MORE("site_menu_opened"),
        AUTO_UPLOAD_POST_INVOKED,
        AUTO_UPLOAD_PAGE_INVOKED,
        UNPUBLISHED_REVISION_DIALOG_SHOWN,
        UNPUBLISHED_REVISION_DIALOG_LOAD_LOCAL_VERSION_CLICKED,
        UNPUBLISHED_REVISION_DIALOG_LOAD_UNPUBLISHED_VERSION_CLICKED,
        WELCOME_NO_SITES_INTERSTITIAL_SHOWN,
        WELCOME_NO_SITES_INTERSTITIAL_CREATE_NEW_SITE_TAPPED("welcome_no_sites_interstitial_button_tapped"),
        WELCOME_NO_SITES_INTERSTITIAL_ADD_SELF_HOSTED_SITE_TAPPED("welcome_no_sites_interstitial_button_tapped"),
        WELCOME_NO_SITES_INTERSTITIAL_DISMISSED,
        FEATURED_IMAGE_SET_CLICKED_POST_SETTINGS,
        FEATURED_IMAGE_PICKED_POST_SETTINGS,
        FEATURED_IMAGE_PICKED_GUTENBERG_EDITOR,
        FEATURED_IMAGE_REMOVED_GUTENBERG_EDITOR,
        FEATURED_IMAGE_UPLOAD_CANCELED_POST_SETTINGS,
        FEATURED_IMAGE_UPLOAD_RETRY_CLICKED_POST_SETTINGS,
        FEATURED_IMAGE_REMOVE_CLICKED_POST_SETTINGS,
        MEDIA_EDITOR_SHOWN,
        MEDIA_EDITOR_USED,
        PREPUBLISHING_BOTTOM_SHEET_OPENED,
        PREPUBLISHING_BOTTOM_SHEET_DISMISSED,
        FEATURE_ANNOUNCEMENT_SHOWN_ON_APP_UPGRADE("feature_announcement_shown"),
        FEATURE_ANNOUNCEMENT_SHOWN_FROM_APP_SETTINGS("feature_announcement_shown"),
        FEATURE_ANNOUNCEMENT_FIND_OUT_MORE_TAPPED("feature_announcement_button_tapped"),
        FEATURE_ANNOUNCEMENT_CLOSE_DIALOG_BUTTON_TAPPED("feature_announcement_button_tapped"),
        PAGES_LIST_AUTHOR_FILTER_CHANGED,
        EDITOR_GUTENBERG_UNSUPPORTED_BLOCK_WEBVIEW_SHOWN("gutenberg_unsupported_block_webview_shown"),
        EDITOR_GUTENBERG_UNSUPPORTED_BLOCK_WEBVIEW_CLOSED("gutenberg_unsupported_block_webview_closed"),
        SELECT_INTERESTS_SHOWN,
        SELECT_INTERESTS_PICKED,
        READER_FOLLOWING_SHOWN,
        READER_LIKED_SHOWN,
        READER_SAVED_LIST_SHOWN,
        READER_CUSTOM_TAB_SHOWN,
        READER_TAGS_FEED_SHOWN,
        READER_DISCOVER_SHOWN,
        READER_DISCOVER_PAGINATED,
        READER_DISCOVER_TOPIC_TAPPED,
        READER_POST_CARD_TAPPED,
        READER_PULL_TO_REFRESH,
        POST_CARD_MORE_TAPPED,
        READER_ARTICLE_DETAIL_MORE_TAPPED,
        READER_CHIPS_MORE_TOGGLED,
        ENCRYPTED_LOGGING_UPLOAD_SUCCESSFUL,
        ENCRYPTED_LOGGING_UPLOAD_FAILED,
        READER_POST_REPORTED,
        READER_USER_REPORTED,
        READER_POST_MARKED_AS_SEEN("reader_mark_as_seen"),
        READER_POST_MARKED_AS_UNSEEN("reader_mark_as_unseen"),
        SUGGESTION_SESSION_FINISHED,
        COMMENT_APPROVED,
        COMMENT_UNAPPROVED,
        COMMENT_SPAMMED,
        COMMENT_UNSPAMMED,
        COMMENT_LIKED,
        COMMENT_UNLIKED,
        COMMENT_TRASHED,
        COMMENT_UNTRASHED,
        COMMENT_REPLIED_TO,
        COMMENT_EDITED,
        COMMENT_VIEWED,
        COMMENT_DELETED,
        COMMENT_MODERATION_UNDO,
        COMMENT_QUICK_ACTION_APPROVED("comment_approved"),
        COMMENT_QUICK_ACTION_LIKED("comment_liked"),
        COMMENT_QUICK_ACTION_REPLIED_TO("comment_replied_to"),
        COMMENT_FOLLOW_CONVERSATION,
        COMMENT_BATCH_APPROVED,
        COMMENT_BATCH_UNAPPROVED,
        COMMENT_BATCH_SPAMMED,
        COMMENT_BATCH_TRASHED,
        COMMENT_BATCH_DELETED,
        COMMENT_EDITOR_OPENED,
        COMMENT_FILTER_CHANGED,
        JETPACK_RESTORE_OPENED,
        JETPACK_RESTORE_CONFIRMED,
        JETPACK_RESTORE_ERROR,
        JETPACK_BACKUP_DOWNLOAD_OPENED,
        JETPACK_BACKUP_DOWNLOAD_CONFIRMED,
        JETPACK_BACKUP_DOWNLOAD_ERROR,
        JETPACK_BACKUP_DOWNLOAD_FILE_DOWNLOAD_TAPPED,
        JETPACK_BACKUP_DOWNLOAD_SHARE_LINK_TAPPED,
        MY_SITE_CREATE_SHEET_SHOWN,
        MY_SITE_CREATE_SHEET_ACTION_TAPPED,
        MY_SITE_CREATE_SHEET_ANSWER_PROMPT_TAPPED,
        MY_SITE_CREATE_SHEET_PROMPT_HELP_TAPPED,
        MY_SITE_CREATE_FAB_SHOWN,
        READER_CREATE_SHEET_SHOWN,
        READER_CREATE_SHEET_ACTION_TAPPED,
        READER_CREATE_SHEET_ANSWER_PROMPT_TAPPED,
        READER_CREATE_SHEET_PROMPT_HELP_TAPPED,
        READER_CREATE_FAB_SHOWN,
        BLOGGING_PROMPTS_CREATE_SHEET_CARD_VIEWED,
        MY_SITE_NO_SITES_VIEW_DISPLAYED,
        MY_SITE_NO_SITES_VIEW_ACTION_TAPPED,
        MY_SITE_NO_SITES_VIEW_HIDDEN,
        POST_LIST_CREATE_SHEET_SHOWN,
        POST_LIST_CREATE_SHEET_ACTION_TAPPED,
        INVITE_LINKS_GET_STATUS,
        INVITE_LINKS_GENERATE,
        INVITE_LINKS_DISABLE,
        INVITE_LINKS_SHARE,
        JETPACK_BACKUP_DOWNLOAD_FILE_NOTICE_DOWNLOAD_TAPPED,
        JETPACK_BACKUP_DOWNLOAD_FILE_NOTICE_DISMISSED_TAPPED,
        ACTIVITY_LOG_DOWNLOAD_FILE_NOTICE_DOWNLOAD_TAPPED,
        ACTIVITY_LOG_DOWNLOAD_FILE_NOTICE_DISMISSED_TAPPED,
        USER_PROFILE_SHEET_SHOWN,
        USER_PROFILE_SHEET_SITE_SHOWN,
        BLOG_URL_PREVIEWED,
        LIKE_LIST_OPENED,
        LIKE_LIST_FETCHED_MORE,
        STORAGE_WARNING_SHOWN,
        STORAGE_WARNING_ACKNOWLEDGED,
        STORAGE_WARNING_CANCELED,
        STORAGE_WARNING_DONT_SHOW_AGAIN,
        BLOGGING_REMINDERS_SCREEN_SHOWN,
        BLOGGING_REMINDERS_BUTTON_PRESSED,
        BLOGGING_REMINDERS_FLOW_START,
        BLOGGING_REMINDERS_FLOW_DISMISSED,
        BLOGGING_REMINDERS_FLOW_COMPLETED,
        BLOGGING_REMINDERS_SCHEDULED,
        BLOGGING_REMINDERS_CANCELLED,
        BLOGGING_REMINDERS_NOTIFICATION_RECEIVED,
        BLOGGING_REMINDERS_INCLUDE_PROMPT_TAPPED,
        BLOGGING_REMINDERS_INCLUDE_PROMPT_HELP_TAPPED,
        LOGIN_EPILOGUE_CHOOSE_SITE_TAPPED,
        LOGIN_EPILOGUE_CREATE_NEW_SITE_TAPPED,
        CREATE_SITE_NOTIFICATION_SCHEDULED,
        RECOMMEND_APP_ENGAGED,
        RECOMMEND_APP_CONTENT_FETCH_FAILED,
        EDITOR_BLOCK_INSERTED,
        EDITOR_BLOCK_MOVED,
        ABOUT_SCREEN_SHOWN,
        ABOUT_SCREEN_DISMISSED,
        ABOUT_SCREEN_BUTTON_TAPPED,
        MY_SITE_DASHBOARD_CARD_FOOTER_ACTION_TAPPED,
        MY_SITE_PULL_TO_REFRESH,
        MY_SITE_MENU_ITEM_TAPPED,
        MY_SITE_DASHBOARD_CARD_SHOWN,
        MY_SITE_DASHBOARD_CARD_ITEM_TAPPED,
        MY_SITE_TAB_TAPPED,
        MY_SITE_DASHBOARD_SHOWN,
        MY_SITE_SITE_MENU_SHOWN,
        APP_SETTINGS_INITIAL_SCREEN_CHANGED,
        CHANGE_USERNAME_DISPLAYED,
        CHANGE_USERNAME_DISMISSED,
        CHANGE_USERNAME_SEARCH_PERFORMED,
        ADD_SITE_ALERT_DISPLAYED,
        MY_SITE_SITE_SWITCHER_TAPPED,
        SITE_SWITCHER_DISPLAYED,
        SITE_SWITCHER_SEARCH_PERFORMED,
        SITE_SWITCHER_ADD_SITE_TAPPED,
        SITE_SWITCHER_TOGGLED_PIN_TAPPED,
        SITE_SWITCHER_SITE_TAPPED,
        SITE_SWITCHER_PIN_UPDATED,
        SITE_SWITCHER_DISMISSED,
        SETTINGS_DID_CHANGE,
        APP_SETTINGS_APPEARANCE_CHANGED,
        APP_SETTINGS_PRIVACY_SETTINGS_TAPPED,
        APP_SETTINGS_OPEN_DEVICE_SETTINGS_TAPPED,
        APP_SETTINGS_MAX_IMAGE_SIZE_CHANGED,
        APP_SETTINGS_IMAGE_QUALITY_CHANGED,
        APP_SETTINGS_REMOVE_LOCATION_FROM_MEDIA_CHANGED,
        APP_SETTINGS_VIDEO_OPTIMIZATION_CHANGED,
        APP_SETTINGS_MAX_VIDEO_SIZE_CHANGED,
        APP_SETTINGS_VIDEO_QUALITY_CHANGED,
        PRIVACY_SETTINGS_OPENED,
        PRIVACY_SETTINGS_REPORT_CRASHES_TOGGLED,
        SHARING_BUTTONS_EDIT_SHARING_BUTTONS_CHANGED,
        SHARING_BUTTONS_EDIT_MORE_SHARING_BUTTONS_CHANGED,
        PEOPLE_MANAGEMENT_USER_INVITED,
        PEOPLE_MANAGEMENT_FILTER_CHANGED,
        READER_FILTER_SHEET_CLEARED,
        READER_FILTER_SHEET_DISMISSED,
        READER_FILTER_SHEET_DISPLAYED,
        READER_FILTER_SHEET_ITEM_SELECTED,
        READER_FILTER_SHEET_TAB_SELECTED,
        READER_SEARCH_HISTORY_CLEARED,
        READER_MANAGE_VIEW_DISMISSED,
        READER_MANAGE_VIEW_DISPLAYED,
        READER_ARTICLE_IMAGE_TAPPED,
        READER_ARTICLE_LINK_TAPPED,
        READER_ARTICLE_FILE_DOWNLOAD_TAPPED,
        READER_ARTICLE_PAGE_JUMP_TAPPED,
        READER_ARTICLE_FEATURED_IMAGE_TAPPED,
        READER_ARTICLE_CUSTOM_VIEW_SHOWN,
        READER_ARTICLE_CUSTOM_VIEW_HIDDEN,
        WEBVIEW_DISMISSED,
        WEBVIEW_DISPLAYED,
        WEBVIEW_NAVIGATED_BACK,
        WEBVIEW_NAVIGATED_FORWARD,
        WEBVIEW_OPEN_IN_BROWSER_TAPPED,
        WEBVIEW_RELOAD_TAPPED,
        WEBVIEW_SHARE_TAPPED,
        WEBVIEW_PREVIEW_DEVICE_CHANGED,
        BLOGGING_PROMPTS_MY_SITE_CARD_ANSWER_PROMPT_CLICKED("blogging_prompts_my_site_card_answer_prompt_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_SHARE_CLICKED("blogging_prompts_my_site_card_share_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_VIEW_ANSWERS_CLICKED("blogging_prompts_my_site_card_view_answers_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_MENU_CLICKED("blogging_prompts_my_site_card_menu_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_MENU_VIEW_MORE_PROMPTS_CLICKED("blogging_prompts_my_site_card_menu_view_more_prompts_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_MENU_SKIP_THIS_PROMPT_CLICKED("blogging_prompts_my_site_card_menu_skip_this_prompt_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_MENU_REMOVE_FROM_DASHBOARD_CLICKED("blogging_prompts_my_site_card_menu_remove_from_dashboard_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_MENU_SKIP_THIS_PROMPT_UNDO_CLICKED("blogging_prompts_my_site_card_menu_skip_this_prompt_undo_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_MENU_REMOVE_FROM_DASHBOARD_UNDO_CLICKED("blogging_prompts_my_site_card_menu_remove_from_dashboard_undo_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_MENU_LEARN_MORE_CLICKED("blogging_prompts_my_site_card_menu_learn_more_tapped"),
        BLOGGING_PROMPTS_MY_SITE_CARD_VIEWED,
        BLOGGING_PROMPTS_INTRODUCTION_SCREEN_VIEWED("blogging_prompts_introduction_modal_viewed"),
        BLOGGING_PROMPTS_INTRODUCTION_SCREEN_DISMISSED("blogging_prompts_introduction_modal_dismissed"),
        BLOGGING_PROMPTS_INTRODUCTION_TRY_IT_NOW_CLICKED("blogging_prompts_introduction_modal_try_it_now_tapped"),
        BLOGGING_PROMPTS_INTRODUCTION_REMIND_ME_CLICKED("blogging_prompts_introduction_modal_remind_me_tapped"),
        BLOGGING_PROMPTS_INTRODUCTION_GOT_IT_CLICKED("blogging_prompts_introduction_modal_got_it_tapped"),
        BLOGGING_PROMPTS_LIST_SCREEN_VIEWED("blogging_prompts_prompts_list_viewed"),
        BLOGGING_PROMPTS_LIST_ITEM_TAPPED,
        BLOGGING_PROMPTS_SETTINGS_SHOW_PROMPTS_TAPPED,
        BLOGGING_REMINDERS_NOTIFICATION_PROMPT_ANSWER_TAPPED,
        BLOGGING_REMINDERS_NOTIFICATION_PROMPT_DISMISS_TAPPED,
        BLOGGING_REMINDERS_NOTIFICATION_PROMPT_TAPPED,
        BLOGGING_REMINDERS_NOTIFICATION_PROMPT_DISMISSED,
        QRLOGIN_SCANNER_DISPLAYED,
        QRLOGIN_SCANNER_DISMISSED,
        QRLOGIN_SCANNER_SCANNED_CODE,
        QRLOGIN_VERIFY_DISPLAYED,
        QRLOGIN_VERIFY_TOKEN_VALIDATED,
        QRLOGIN_VERIFY_CANCELLED,
        QRLOGIN_VERIFY_APPROVED,
        QRLOGIN_AUTHENTICATED,
        QRLOGIN_VERIFY_DISMISS,
        QRLOGIN_VERIFY_FAILED,
        QRLOGIN_VERIFY_SCAN_AGAIN,
        JETPACK_POWERED_BANNER_TAPPED,
        JETPACK_POWERED_BADGE_TAPPED,
        REMOVE_STATIC_POSTER_DISPLAYED,
        REMOVE_STATIC_POSTER_GET_JETPACK_TAPPED,
        REMOVE_STATIC_POSTER_LINK_TAPPED,
        JETPACK_POWERED_BOTTOM_SHEET_GET_JETPACK_APP_TAPPED,
        JETPACK_POWERED_BOTTOM_SHEET_CONTINUE_TAPPED,
        SHARED_LOGIN_START,
        SHARED_LOGIN_SUCCESS,
        SHARED_LOGIN_FAILED,
        MIGRATION_EMAIL_TRIGGERED,
        MIGRATION_EMAIL_FAILED,
        CONTENT_MIGRATION_FAILED,
        JPMIGRATION_WELCOME_SCREEN_SHOWN,
        JPMIGRATION_WELCOME_SCREEN_CONTINUE_BUTTON_TAPPED,
        JPMIGRATION_WELCOME_SCREEN_HELP_BUTTON_TAPPED,
        JPMIGRATION_WELCOME_SCREEN_AVATAR_TAPPED,
        JPMIGRATION_NOTIFICATIONS_SCREEN_SHOWN,
        JPMIGRATION_NOTIFICATIONS_SCREEN_CONTINUE_BUTTON_TAPPED,
        JPMIGRATION_THANKS_SCREEN_SHOWN,
        JPMIGRATION_THANKS_SCREEN_FINISH_BUTTON_TAPPED,
        JPMIGRATION_PLEASE_DELETE_WORDPRESS_CARD_TAPPED,
        JPMIGRATION_PLEASE_DELETE_WORDPRESS_SCREEN_SHOWN,
        JPMIGRATION_PLEASE_DELETE_WORDPRESS_GOTIT_TAPPED,
        JPMIGRATION_PLEASE_DELETE_WORDPRESS_HELP_BUTTON_TAPPED,
        JPMIGRATION_ERROR_SCREEN_SHOWN,
        JPMIGRATION_ERROR_SCREEN_HELP_BUTTON_TAPPED,
        JPMIGRATION_ERROR_SCREEN_RETRY_BUTTON_TAPPED,
        JPMIGRATION_WORDPRESSAPP_DETECTED,
        USER_FLAGS_START,
        USER_FLAGS_SUCCESS,
        USER_FLAGS_FAILED,
        BLOGGING_REMINDERS_SYNC_START,
        BLOGGING_REMINDERS_SYNC_SUCCESS,
        BLOGGING_REMINDERS_SYNC_FAILED,
        READER_SAVED_POSTS_START,
        READER_SAVED_POSTS_SUCCESS,
        READER_SAVED_POSTS_FAILED,
        DEEPLINK_CUSTOM_INTENT_RECEIVED,
        APP_SETTINGS_OPEN_WEB_LINKS_WITH_JETPACK_CHANGED,
        JETPACK_REMOVE_FEATURE_OVERLAY_DISPLAYED("remove_feature_overlay_displayed"),
        JETPACK_REMOVE_FEATURE_OVERLAY_LINK_TAPPED("remove_feature_overlay_link_tapped"),
        JETPACK_REMOVE_FEATURE_OVERLAY_BUTTON_GET_JETPACK_APP_TAPPED("remove_feature_overlay_button_tapped"),
        JETPACK_REMOVE_FEATURE_OVERLAY_DISMISSED("remove_feature_overlay_dismissed"),
        JETPACK_REMOVE_FEATURE_OVERLAY_LEARN_MORE_TAPPED("remove_feature_overlay_link_tapped"),
        JETPACK_REMOVE_SITE_CREATION_OVERLAY_DISPLAYED("remove_site_creation_overlay_displayed"),
        JETPACK_REMOVE_SITE_CREATION_OVERLAY_BUTTON_GET_JETPACK_APP_TAPPED("remove_site_creation_overlay_button_tapped"),
        JETPACK_REMOVE_SITE_CREATION_OVERLAY_DISMISSED("remove_site_creation_overlay_dismissed"),
        JETPACK_DEEP_LINK_OVERLAY_DISPLAYED,
        JETPACK_DEEP_LINK_OVERLAY_BUTTON_OPEN_IN_JETPACK_APP_TAPPED,
        JETPACK_DEEP_LINK_OVERLAY_DISMISSED,
        REMOVE_FEATURE_CARD_DISPLAYED,
        REMOVE_FEATURE_CARD_TAPPED,
        REMOVE_FEATURE_CARD_LINK_TAPPED,
        REMOVE_FEATURE_CARD_MENU_ACCESSED,
        REMOVE_FEATURE_CARD_HIDE_TAPPED,
        REMOVE_FEATURE_CARD_REMIND_LATER_TAPPED,
        JETPACK_FEATURE_INCORRECTLY_ACCESSED,
        JETPACK_INSTALL_FULL_PLUGIN_CARD_VIEWED("jp_install_full_plugin_card_viewed"),
        JETPACK_INSTALL_FULL_PLUGIN_CARD_TAPPED("jp_install_full_plugin_card_tapped"),
        JETPACK_INSTALL_FULL_PLUGIN_CARD_DISMISSED("jp_install_full_plugin_card_dismissed"),
        JETPACK_FULL_PLUGIN_INSTALL_ONBOARDING_SCREEN_SHOWN("jp_install_full_plugin_onboarding_modal_viewed"),
        JETPACK_FULL_PLUGIN_INSTALL_ONBOARDING_SCREEN_DISMISSED("jp_install_full_plugin_onboarding_modal_dismissed"),
        JETPACK_FULL_PLUGIN_INSTALL_ONBOARDING_INSTALL_TAPPED("jp_install_full_plugin_onboarding_modal_install_tapped"),
        JETPACK_INSTALL_FULL_PLUGIN_FLOW_VIEWED("jp_install_full_plugin_flow_viewed"),
        JETPACK_INSTALL_FULL_PLUGIN_FLOW_CANCEL_TAPPED("jp_install_full_plugin_flow_cancel_tapped"),
        JETPACK_INSTALL_FULL_PLUGIN_FLOW_INSTALL_TAPPED("jp_install_full_plugin_flow_install_tapped"),
        JETPACK_INSTALL_FULL_PLUGIN_FLOW_RETRY_TAPPED("jp_install_full_plugin_flow_retry_tapped"),
        JETPACK_INSTALL_FULL_PLUGIN_FLOW_SUCCESS("jp_install_full_plugin_flow_success"),
        JETPACK_INSTALL_FULL_PLUGIN_FLOW_DONE_TAPPED("jp_install_full_plugin_flow_done_tapped"),
        BLAZE_ENTRY_POINT_DISPLAYED,
        BLAZE_ENTRY_POINT_TAPPED,
        BLAZE_ENTRY_POINT_MENU_ACCESSED,
        BLAZE_ENTRY_POINT_LEARN_MORE_TAPPED,
        BLAZE_ENTRY_POINT_HIDE_TAPPED,
        BLAZE_FEATURE_OVERLAY_DISPLAYED("blaze_overlay_displayed"),
        BLAZE_FEATURE_OVERLAY_PROMOTE_CLICKED("blaze_overlay_button_tapped"),
        BLAZE_FEATURE_OVERLAY_DISMISSED("blaze_overlay_dismissed"),
        BLAZE_FLOW_STARTED,
        BLAZE_FLOW_COMPLETED,
        BLAZE_FLOW_CANCELED,
        BLAZE_FLOW_ERROR,
        BLAZE_CAMPAIGN_LISTING_PAGE_SHOWN("blaze_campaign_list_opened"),
        BLAZE_CAMPAIGN_DETAIL_PAGE_OPENED("blaze_campaign_details_opened"),
        WP_JETPACK_INDIVIDUAL_PLUGIN_OVERLAY_SHOWN("wp_individual_site_overlay_viewed"),
        WP_JETPACK_INDIVIDUAL_PLUGIN_OVERLAY_DISMISSED("wp_individual_site_overlay_dismissed"),
        WP_JETPACK_INDIVIDUAL_PLUGIN_OVERLAY_PRIMARY_TAPPED("wp_individual_site_overlay_primary_tapped"),
        DASHBOARD_CARD_PLANS_SHOWN("free_to_paid_plan_dashboard_card_shown"),
        DASHBOARD_CARD_PLANS_TAPPED("free_to_paid_plan_dashboard_card_tapped"),
        DASHBOARD_CARD_PLANS_MORE_MENU_TAPPED("free_to_paid_plan_dashboard_card_menu_tapped"),
        DASHBOARD_CARD_PLANS_HIDDEN("free_to_paid_plan_dashboard_card_hidden"),
        TWITTER_NOTICE_LINK_TAPPED,
        PRIVACY_CHOICES_BANNER_PRESENTED,
        PRIVACY_CHOICES_BANNER_SETTINGS_BUTTON_TAPPED,
        PRIVACY_CHOICES_BANNER_SAVE_BUTTON_TAPPED,
        JETPACK_SOCIAL_AUTO_SHARING_CONNECTION_TOGGLED,
        JETPACK_SOCIAL_SHARE_LIMIT_DISPLAYED,
        JETPACK_SOCIAL_UPGRADE_LINK_TAPPED,
        JETPACK_SOCIAL_ADD_CONNECTION_CTA_DISPLAYED,
        JETPACK_SOCIAL_ADD_CONNECTION_TAPPED,
        JETPACK_SOCIAL_ADD_CONNECTION_DISMISSED,
        MY_SITE_DASHBOARD_CARD_MENU_ITEM_TAPPED,
        MY_SITE_DASHBOARD_CONTEXTUAL_MENU_ACCESSED,
        PERSONALIZATION_SCREEN_CARD_HIDE_TAPPED,
        PERSONALIZATION_SCREEN_CARD_SHOW_TAPPED,
        PERSONALIZATION_SCREEN_SHORTCUT_SHOW_QUICK_LINK_TAPPED,
        PERSONALIZATION_SCREEN_SHORTCUT_HIDE_QUICK_LINK_TAPPED,
        QUICK_LINK_ITEM_TAPPED,
        MORE_MENU_ITEM_TAPPED,
        POST_LIST_CREATE_POST_TAPPED,
        DOMAIN_MANAGEMENT_ME_DOMAINS_TAPPED,
        DOMAIN_MANAGEMENT_DOMAINS_DASHBOARD_ALL_DOMAINS_TAPPED,
        DOMAIN_MANAGEMENT_DOMAINS_LIST_SHOWN,
        DOMAIN_MANAGEMENT_DOMAIN_DETAILS_WEB_VIEW_SHOWN,
        DOMAIN_MANAGEMENT_ADD_DOMAIN_TAPPED,
        DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_SCREEN_SHOWN,
        DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_GET_DOMAIN_TAPPED,
        DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_CHOOSE_SITE_TAPPED,
        DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_SITE_SELECTED,
        DOMAIN_MANAGEMENT_DOMAINS_SEARCH_SHOWN,
        DOMAIN_MANAGEMENT_SEARCH_DOMAIN_TAPPED,
        DOMAIN_MANAGEMENT_DOMAINS_SEARCH_TRANSFER_DOMAIN_TAPPED,
        DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_COMPLETED,
        LOGIN_SECURITY_KEY_FAILURE,
        LOGIN_2FA_NEEDED,
        LOGIN_SECURITY_KEY_SUCCESS,
        LOGIN_SECURITY_KEY_CLICKED,
        BARCODE_SCANNING_SUCCESS,
        BARCODE_SCANNING_FAILURE,
        QRLOGIN_SCANNER_DISMISSED_CAMERA_PERMISSION_DENIED,
        BLOGANUARY_NUDGE_MY_SITE_CARD_LEARN_MORE_TAPPED,
        BLOGANUARY_NUDGE_LEARN_MORE_MODAL_SHOWN,
        BLOGANUARY_NUDGE_LEARN_MORE_MODAL_DISMISSED,
        BLOGANUARY_NUDGE_LEARN_MORE_MODAL_ACTION_TAPPED,
        SOTW_2023_NUDGE_POST_EVENT_CARD_SHOWN,
        SOTW_2023_NUDGE_POST_EVENT_CARD_HIDE_TAPPED,
        SOTW_2023_NUDGE_POST_EVENT_CARD_CTA_TAPPED,
        DYNAMIC_DASHBOARD_CARD_SHOWN,
        DYNAMIC_DASHBOARD_CARD_TAPPED,
        DYNAMIC_DASHBOARD_CARD_CTA_TAPPED,
        DYNAMIC_DASHBOARD_CARD_HIDE_TAPPED,
        DEEP_LINK_FAILED,
        READER_DROPDOWN_MENU_OPENED,
        READER_DROPDOWN_MENU_ITEM_TAPPED,
        SITE_MONITORING_SCREEN_SHOWN,
        OPENED_SITE_MONITORING,
        SITE_MONITORING_TAB_SHOWN,
        SITE_MONITORING_TAB_LOADING_ERROR,
        NOTIFICATION_MENU_TAPPED,
        NOTIFICATIONS_MARK_ALL_READ_TAPPED,
        NOTIFICATIONS_INLINE_ACTION_TAPPED,
        WEBVIEW_TOO_LARGE_PAYLOAD_ERROR,
        RESOLVE_CONFLICT_SCREEN_SHOWN,
        RESOLVE_CONFLICT_CONFIRM_TAPPED,
        RESOLVE_CONFLICT_CANCEL_TAPPED,
        RESOLVE_CONFLICT_CLOSE_TAPPED,
        RESOLVE_CONFLICT_DISMISSED,
        RESOLVE_AUTOSAVE_CONFLICT_SCREEN_SHOWN,
        RESOLVE_AUTOSAVE_CONFLICT_CONFIRM_TAPPED,
        RESOLVE_AUTOSAVE_CONFLICT_CANCEL_TAPPED,
        RESOLVE_AUTOSAVE_CONFLICT_CLOSE_TAPPED,
        RESOLVE_AUTOSAVE_CONFLICT_DISMISSED,
        IN_APP_UPDATE_SHOWN,
        IN_APP_UPDATE_DISMISSED,
        IN_APP_UPDATE_ACCEPTED,
        IN_APP_UPDATE_COMPLETED_WITH_APP_RESTART_BY_USER,
        VOICE_TO_CONTENT_SHEET_SHOWN,
        VOICE_TO_CONTENT_BUTTON_START_RECORDING_TAPPED,
        VOICE_TO_CONTENT_BUTTON_DONE_TAPPED,
        VOICE_TO_CONTENT_BUTTON_UPGRADE_TAPPED,
        VOICE_TO_CONTENT_BUTTON_CLOSE_TAPPED,
        VOICE_TO_CONTENT_BUTTON_RECORDING_LIMIT_REACHED,
        BACKGROUND_REST_AUTODISCOVERY_SUCCESSFUL,
        BACKGROUND_REST_AUTODISCOVERY_FAILED,
        WP_ANDROID_APPLICATION_PASSWORD_LOGIN,
        JP_ANDROID_APPLICATION_PASSWORD_LOGIN,
        APPLICATION_PASSWORD_SET_OFF;
        /*
         * Please set the event name in the enum only if the new Stat's name in lower case does not match it.
         * In that case you also need to add the event in the `AnalyticsTrackerNosaraTest.specialNames` map.
         */

        private String mEventName;

        Stat(String eventName) {
            this.mEventName = eventName;
        }

        Stat() {
            this.mEventName = this.name().toLowerCase(Locale.US);
        }

        public String getEventName() {
            return mEventName;
        }
    }

    private static final List<Tracker> TRACKERS = new ArrayList<>();

    private AnalyticsTracker() {
    }

    public static void init(Context context) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
        boolean hasUserOptedOut = !prefs.getBoolean("wp_pref_send_usage_stats", true);
        if (hasUserOptedOut != mHasUserOptedOut) {
            mHasUserOptedOut = hasUserOptedOut;
        }
    }

    public static boolean hasUserOptedOut() {
        return mHasUserOptedOut;
    }

    public static void setHasUserOptedOut(boolean hasUserOptedOut) {
        if (hasUserOptedOut != mHasUserOptedOut) {
            mHasUserOptedOut = hasUserOptedOut;
        }
    }

    public static void registerTracker(Tracker tracker) {
        if (tracker != null) {
            TRACKERS.add(tracker);
        }
    }

    public static void track(Stat stat) {
        if (mHasUserOptedOut) {
            return;
        }

        for (Tracker tracker : TRACKERS) {
            tracker.track(stat);
        }
    }

    public static @Nullable String getAnonID() {
        if (TRACKERS.isEmpty()) {
            return null;
        }
        Tracker tracker = TRACKERS.get(0);
        String anonId = tracker.getAnonID();
        if (anonId == null) {
            return tracker.generateNewAnonID();
        } else {
            return anonId;
        }
    }

    public static void track(Stat stat, Map<String, ?> properties) {
        if (mHasUserOptedOut) {
            return;
        }

        for (Tracker tracker : TRACKERS) {
            tracker.track(stat, properties);
        }
    }

    /**
     * A convenience method for logging an error event with some additional meta data.
     * @param stat The stat to track.
     * @param errorContext A string providing additional context (if any) about the error.
     * @param errorType The type of error.
     * @param errorDescription The error text or other description.
     */
    public static void track(Stat stat, String errorContext, String errorType, String errorDescription) {
        Map<String, String> props = new HashMap<>();
        props.put("error_context", errorContext);
        props.put("error_type", errorType);
        props.put("error_description", errorDescription);
        track(stat, props);
    }

    public static void flush() {
        if (mHasUserOptedOut) {
            return;
        }
        for (Tracker tracker : TRACKERS) {
            tracker.flush();
        }
    }

    public static void endSession(boolean force) {
        if (mHasUserOptedOut && !force) {
            return;
        }
        for (Tracker tracker : TRACKERS) {
            tracker.endSession();
        }
    }

    public static void clearAllData() {
        for (Tracker tracker : TRACKERS) {
            tracker.clearAllData();
        }
    }

    public static void refreshMetadata(AnalyticsMetadata metadata) {
        for (Tracker tracker : TRACKERS) {
            tracker.refreshMetadata(metadata);
        }
    }
}
